package audio;

import dao.ContentManager;

/**
 * 
 * @author Ygor
 *
 */
public class AudioManager {
	private static MidiPlayer midiPlayer = new MidiPlayer();
	private static WavPlayer wavPlayer = new WavPlayer();
	
	public static void playMidi(String midiFile, boolean isLooping) {
		try {
			midiPlayer.play(ContentManager.loadMidi(midiFile), isLooping);
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println("Erro tentando tocar a midi! " + midiFile);
		}
	}
	
	public static void playWav(String wavFile) {
		try {
			wavPlayer.play(ContentManager.loadWav(wavFile));
		} catch (Exception e) {
			e.printStackTrace();
			System.out.println("Erro tentando tocar a wav! " + wavFile);
		}
	}
	
	public void pauseMidi(boolean pause) {
		midiPlayer.setPaused(pause);
	}
	public void stopMidi() {
		midiPlayer.stop();
	}
}
